home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 009a / snpd0493.zip / SHEL2DOS.C < prev    next >
C/C++ Source or Header  |  1993-04-05  |  473b  |  24 lines

  1. .I 9 1
  2. #include <stdio.h>
  3. .I 11 1
  4. #include <process.h>
  5. .I 14 2
  6.       char *comspec, prompt[256], *oldprompt;
  7.       int retval;
  8. .D 15 1
  9. .I 21 1
  10.             oldprompt = getenv("PROMPT"));
  11. .D 22 2
  12. .I 25 6
  13.       retval = spawnlp(0, comspec, NULL, "/p", NULL);
  14.  
  15.       sprintf(prompt, "PROMPT=%s", oldprompt);
  16.       putenv(prompt);
  17.  
  18.       return retval;
  19. .D 26 1
  20. .I 37 3
  21.  
  22.       retval = shell_to_DOS();
  23.       printf("shell_to_DOS() returned %d\n", retval);
  24.